.m-outer {
  width: 400px;
  height: 400px;
  border: 1px solid red;
  overflow: hidden;
  display: flex;
  align-items: center;
}
.m-inner {
  display: inline-block;
  // background-color: rgba(green, 0.1);
  transform: translate(0, 0) scale(1);
}
$gap: 20px;
.node {
  position: relative;
  display: flex;
  align-items: center;
  // 竖线
  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 100%;
    box-sizing: border-box;
    border-left: 1px solid #ccc;
  }
  &:nth-of-type(1)::before {
    height: 50%;
    top: 50%;
  }
  &:nth-last-of-type(1)::before {
    height: 50%;
  }
  &:only-of-type::before {
    content: normal;
  }
}
.node-item {
  position: relative;
  width: 200px;
  box-sizing: border-box;
  padding: 8px $gap;
  // 横线
  &::before {
    content: '';
    position: absolute;
    z-index: -1;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    box-sizing: border-box;
    border-bottom: 1px solid #ccc;
  }
  &.is-root::before {
    width: calc(100% - $gap);
    left: $gap;
  }
  &.is-leaf::before {
    width: $gap;
  }
  &.is-expand {
    + .node-children {
      display: block;
    }
  }
  &.is-collapse {
    + .node-children {
      display: none;
    }
    &::before {
      width: $gap;
    }
  }
}
.node-item-label {
  display: inline-block;
  background-color: #fff;
  box-sizing: border-box;
  padding: 0 8px;
  white-space: normal;
  word-break: break-all;
  overflow-wrap: break-word;
  font-size: 14px;
  color: #333;
  font-weight: normal;
  cursor: pointer;
  &:hover {
    color: red;
  }
  &.is-active {
    color: red;
    font-weight: bold;
  }
}
